package com.liang.service;

import com.liang.entity.Student;
import com.liang.service.impl.FeignError;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.Collection;

/**
 * Created with Intellij IDEA
 *
 * @Auther: liangjy
 * @Date: 2021/12/24/8:54
 * @Description: 声明式接口  无需再完成实现类
 * @FeignClient:
 * @Description:在IFeignService接口定义处定义@FeignClient的fallback属性来做降级处理，设置映射，映射到FeignServiceImpl中去。修改IFeignService后代码如下：
 * 如果指定的接口能掉通
 */
@FeignClient(value = "provider",fallback = FeignError.class)
public interface FeignProviderClient {

    @GetMapping("/student/findAll")
    public Collection<Student> findAll();

    @GetMapping("/student/index")
    public String index();
}
